package com.achao.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.OutputStream;
import java.io.PrintWriter;

/**
 * @Author: achao
 * @DateTime: 2022/8/9 19:20
 * @Description: TODO
 */

@Data
public class Response {

    private OutputStream outputStream;

    public Response() {
    }

    public Response(OutputStream outputStream) {
        this.outputStream = outputStream;
    }


    public void write(String str) {
        PrintWriter pw = new PrintWriter(outputStream);
        pw.println("HTTP/1.1 200 OK");
        pw.println("Content-Type:text/html;charset=utf-8");
        pw.println();
        pw.println("脑壳疼,大家给个三连吧!!!!!!");
        pw.println("<br/><h1 style='color:red'>"+str+"！</h1>");
        pw.flush();
        pw.close();
    }

}
